package com.example.lib_base.debugutil

import android.app.ActivityManager
import android.content.Context
import android.util.Log

class ActivityStackStateUtil {

    fun logShowActivityState(context:Context){
        val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
        val taskInfo = activityManager.getRunningTasks(10) // 获取前10个任务
        for (task in taskInfo) {
            Log.d("ActivityStack", "Task: ${task.baseActivity?.shortClassName}")
        }
    }
}